Remove ltrtim(). No callers remain.
authorRobert Lipe <robertlipe@gmail.com>
Wed, 8 Feb 2023 06:49:28 +0000 (00:49 -0600)
committerRobert Lipe <robertlipe@gmail.com>
Wed, 8 Feb 2023 06:49:28 +0000 (00:49 -0600)
defs.h
util.cc

diff --git a/defs.h b/defs.h
index 25ef7fe91559cec6d8f2f4245cfd9c418b693de5..495453cad8803047cc1893b98ccb040fbc9bc3ec 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1019,7 +1019,6 @@ inline int case_ignore_strncmp(const QString& s1, const QString& s2, int n)
 int str_match(const char* str, const char* match);
 
 void rtrim(char* s);
-char* lrtrim(char* buff);
 int xasprintf(char** strp, const char* fmt, ...) PRINTFLIKE(2, 3);
 int xasprintf(QString* strp, const char* fmt, ...) PRINTFLIKE(2, 3);
 int xasprintf(QScopedPointer<char, QScopedPointerPodDeleter>& strp, const char* fmt, ...) PRINTFLIKE(2, 3);
diff --git a/util.cc b/util.cc
index 4819cdf110459de6e2ad2bc72bf96ec2e454eb37..a5bad51187539d9012f700ec9cc8905716128418 100644 (file)
--- a/util.cc
+++ b/util.cc
@@ -338,39 +338,6 @@ rtrim(char* s)
   }
 }
 
-/*
- * Like trim, but trims whitespace from both beginning and end.
- */
-char*
-lrtrim(char* buff)
-{
-  if (buff[0] == '\0') {
-    return buff;
-  }
-
-  char* c = buff + strlen(buff);
-  while ((c >= buff) && ((unsigned char)*c <= ' ')) {
-    *c-- = '\0';
-  }
-
-  c = buff;
-  while ((*c != '\0') && ((unsigned char)*c <= ' ')) {
-    c++;
-  }
-
-  if (c != buff) {
-    char* src = c;
-    char* dst = buff;
-
-    while (*src) {
-      *dst++ = *src++;
-    }
-    *dst = '\0';
-  }
-
-  return buff;
-}
-
 /*
  * compare str with match
  * match may contain wildcards "*" and "?"